package com.mall4j.cloud.gateway.handler;

import com.mall4j.cloud.gateway.config.ConfigTestProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

/**
 * @author wukai
 * @date 2022/1/28 13:38
 */
@RestController
@RefreshScope
public class TestHandler {
    @Value("${test.msg:aaa}")
    private String msg;
    @Autowired
    private ConfigTestProperty property;
    @GetMapping("/test")
    public Mono<String> showTest(){
        return Mono.just(property.getMsg()+"===="+msg);
    }
}
